---
id: pluginkafka
title: Kafka消息生产
---

:::tip `须知`

插件使用librdkafka,注意在非windows系统中需按系统安装c库

On Mac OSX, install librdkafka with homebrew:
```
$ brew install librdkafka
```
On Debian and Ubuntu, install librdkafka from the Confluent APT repositories, see instructions here and then install librdkafka:
```
$ apt install librdkafka-dev

```
On RedHat, CentOS, Fedora, install librdkafka from the Confluent YUM repositories, instructions here and then install librdkafka:
```
$ yum install librdkafka-devel
```
For other platforms, follow the source building instructions below.
:::


## 一、设备扩展属性

<img src={require('../static/img/docs/pluginkafka-1.png').default} width="300" />

| 属性           |  说明                    | 默认值/备注|
| ---------------| --------------------------| ---|
| 服务地址         | 服务地址              | 127.0.0.1:9092|
| 设备主题         | 设备主题              | |
| 变量主题         | 变量主题              | |
| 客户端ID         | 客户端ID              | test-consumer|
| 线程循环间隔         | 上传线程的循环间隔,一般不需要更改(ms)              | 1000 |
| 发布超时时间         | 连接发布时的超时时间              | 1000 |
| 缓存最大条数         | 离线缓存时的最大条数,这里指的是发布不成功时的缓存次数              | 2000 |
| 列表分割大小         | 发布的实体列表按大小分割              | 1000 |


## 二、变量配置

<img src={require('../static/img/docs/pluginkafka-2.png').default} width="300" />


### 启用

启用变量后才能进行上传
